import os
from pathlib import Path

UPLOAD_FOLDER = 'cache/uploads'
STATIC_FOLDER = 'static'
ALLOWED_EXTENSIONS = {'pdf', 'png', 'jpg', 'jpeg', 'webp'}
MAX_FILE_SIZE = 3 * 1024 * 1024  # 3MB
WORKSPACE_FOLDER = Path(__file__).parent.parent

def allowed_file(filename):
    # 允许上传的文件类型
    return '.' in filename and filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS
